home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Apple II / Essentials / Essentials.sea / File.Type.Notes / FTN.B7.XXXX < prev    next >
Encoding:
Text File  |  1993-06-15  |  3.9 KB  |  76 lines  |  [TEXT/GEOL]

  1. Apple II
  2. File Type Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6. File Type:       $B7 (183)
  7. Auxiliary Type:  All
  8.  
  9. Full Name:       ProDOS 16 or GS/OS Temporary Initialization File
  10. Short Name:      Temporary initialization file
  11.  
  12. Modified by:     Matt Deatherage                                     May 1992
  13. Written by:      Matt Deatherage                               September 1990
  14.  
  15. Files of this type contain initialization code that is unloaded immediately
  16. after executing.
  17.  
  18. CHANGES SINCE SEPTEMBER 1990:  Added new information pertaining to System
  19. Software 6.0 and answered some commonly asked questions.
  20. _____________________________________________________________________________
  21.  
  22. Files of type $B7 contain temporary initialization code.  Such files are often
  23. referred to as "inits".  They are loaded by GS/OS at boot time and are
  24. unloaded immediately after execution.  The auxiliary type is RESERVED except
  25. for bit 15--if bit 15 is set, the initialization file is not loaded.
  26.  
  27. The structure of an init is similar to that of an application.  The first byte
  28. of the loaded code image (inits are load files) is the entry point, and the
  29. init must end with an RTL instruction.  When GS/OS transfers control to a
  30. temporary initialization file, the processor is in 16-bit native mode.  The A
  31. register contains the init's user ID, D points to the bottom of a 4K stack and
  32. direct-page area and S points to near the top of that area.  (If the init has
  33. an OMF stack and direct page segment linked in, the D and S registers point to
  34. it instead.)  The data bank register is not defined; you should save it, set
  35. it and restore it if you use absolute addressing.
  36.  
  37. All inits are loaded and executed entirely after the System Software is
  38. initialized; all of GS/OS is present and all of the tools are startable
  39. (although that's not necessarily advised; see later in this Note).  The
  40. contents of all prefixes are undefined, and you should save and restore any
  41. prefixes you use.  An init that wants to find its own pathname can use the
  42. System Loader call LGetPathname2.  The commonly-seen icons at the bottom of
  43. the graphics screen are only available to CDevs in System Software 5.0 through
  44. 5.0.4, unless you draw the icon yourself, but under 6.0 and later the
  45. Miscellaneous Tools call ShowBootInfo will display an icon on the graphics
  46. screen or a version line on the text screen like GS/OS components.
  47.  
  48. While all tools are available to be started, that doesn't mean tools should
  49. necessarily be started.  Inits can be loaded after boot time (such as with IR
  50. 2.0, DTS Sample Code for an Apple IIgs Finder Extension), and blindly
  51. attempting to start and shut down tools without first checking their status
  52. can be disastrous in such instances.  In particular, inits should never call
  53. TLStartUp or TLShutDown, and should check for the presence of other tools
  54. through each tool's status function before starting it up.
  55.  
  56. Inits that need to tell the difference between boot time and later loading
  57. times (for example, a RAM disk restoration init) can check the result of the
  58. GS/OS call GetName--if there is no name, the system's currently being started
  59. up.
  60.  
  61. Temporary initialization files are shut down by GS/OS after they perform their
  62. RTL, so they are a good choice for transient purposes.  Temporary inits are
  63. good for playing sounds during the boot process, loading pictures, and other
  64. instances where data is passed to other system routines.  For example, a
  65. temporary init might read files from a disk and save them to a RAM disk.  The
  66. init gets to set up the RAM disk, but after that's done it doesn't need to
  67. stick around and take up memory--and since it's a temporary init, GS/OS
  68. unloads it after its work is done.
  69.  
  70.  
  71. Further Reference
  72. _____________________________________________________________________________
  73.  
  74.    o   GS/OS Reference
  75.    o   File Type Note for File Type $B6, Permanent Initialization Files
  76.